{% extends "park/base.html" %}
{% block css %}
{% endblock %}

{% block content %}
    <script type="text/javascript">
        var primary_menu = "menu_4";
        var sub_menu = "menu_4_0";
    </script>    
    <form action="/park/serachDetail/" method="post" >
	    <div class="col-md-12">
	        <div class="panel panel-primary">
	            <div class="panel-heading">
	                <div class="panel-title"><h3>涉及化学物质名称查询</h3></div>
	                <div class="panel-options">
		                <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
		            </div>
	            </div>
	            <div class="panel-body with-table">
	                <table class="table table-bordered table-responsive input_in ">
	                    <tbody>
	                            <tr>
	                                <td width="15%">涉及化学物质名称</td>
	                                <td width="35%"><input type="text" class="form-control valid" name="name" placeholder="" value=""></td>
	                                <td width="15%">CAS号</td>
	                                <td width="35%"><input type="text" class="form-control valid" name="cas" placeholder="" value=""></td>
	                            </tr>
	                            <tr>
	                                <td width="15%">年份选择</td>
	                                <td width="35%"><input class="Wdate time form-control" style="width:100%;" type="text"  name="time" value=""  onfocus="WdatePicker({dateFmt:'yyyy'})" datatype="*" /></td>
	                                <td width="15%"></td>
	                                <td width="35%"></td>
	                            </tr>

	                            <tr>
	                                <td width="15%">化学物质量</td>
	                                <td width="35%">
                                        <input style="width:40%" type="text" class="form-control valid" name="chnumber_x" placeholder="" value="">
                                        ≤
                                        <input style="width:40%" type="text" class="form-control valid" name="chnumber_d" placeholder="" value=""> 吨/年</td>
	                            </tr>

                        <tr>
                            <td width="15%">化学物质种类</td>
                            <td width="35%">
                                        <input style="width:40%" type="text" class="form-control valid" name="cTnumber_x" placeholder="" value="">
                                        ≤
                                        <input style="width:40%" type="text" class="form-control valid" name="cTnumber_d" placeholder="" value=""> 种</td>

                        </tr>
                                <tr>
	                            	<td width="15%">种类</td>
	                                <td colspan="3">
	                                	<label> <input type="checkbox" name="serachType" value="1"> 全部 &nbsp;</label>
	                                	<label> <input type="checkbox" name="serachType" value="2"> 原辅料 &nbsp;</label>
	                                	<label> <input type="checkbox" name="serachType" value="3"> 中间产品 &nbsp;</label>
	                                	<label> <input type="checkbox" name="serachType" value="4"> 产品 &nbsp;</label>
	                                	<label style="color: red;"> {{ error }}&nbsp;</label>
	                                </td>

	                            </tr>
	                    </tbody>
	                </table>
	            </div>
	        </div>
	    </div>
	    <div class="col-md-12">
	        <div class="panel panel-primary">
	            <div class="panel-heading">
	                <div class="panel-title"><h3>企业信息</h3></div>
	                <div class="panel-options">
		                <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
		            </div>
	            </div>
	            <div class="panel-body with-table">
	                <table class="table table-bordered table-responsive">
	                    <tbody>
	                            <tr>
	                                <td width="25%">单位名称</td>
	                                <td width="25%"><input type="text" class="form-control valid" name="ent_name" placeholder="" value=""></td>
	                                <td width="25%">组织机构代码</td>
	                                <td width="25%"><input type="text" class="form-control valid" name="ent_code" placeholder="" value=""></td>
	                            </tr>
	                            <tr>
	                                <td width="25%">行政区划</td>
	                                <td width="25%">
	                                	<select class="form-control" id="se_province" name="register_add0"></select>
	                                </td>
	                                <td width="25%">
				                        <select class="form-control" id="se_city" name="register_add1" ></select>
	                                </td>
	                                <td width="25%">
	                                	<select class="form-control" id="se_county" name="register_add2"></select>
	                                </td>
	                            </tr>
	                            <tr>
	                                <td width="25%">行业分类代码</td>
	                                <td width="25%"><input type="text" class="form-control valid" name="industry_code" placeholder="" value=""></td>
	                                <td width="25%">重点环境管理危险化学品生产企业</td>
	                                <td width="25%">
                                        <select name="enterprise_type">
                                            <option value="1">是</option>
                                            <option value="2">否</option>
                                        </select>
                                    </td>
	                            </tr>
	                            <tr>
	                                <td width="25%">进入工业园区情况</td>
	                                <td width="25%"><input type="text" class="form-control valid" name="industry_park_time" placeholder="" value=""></td>
	                                <td width="25%">所在工业园区名称</td>
	                                <td width="25%">
                                       <input type="text" class="form-control valid" name="industry_park_name" placeholder="" value="">
                                    </td>
	                            </tr>
	                            <tr>
	                                <td width="25%">所在园区代码</td>
	                                <td width="25%">
                                        <input type="text" class="form-control valid" name="industry_park_code" placeholder="" value="">
                                    </td>
	                                <td width="25%"></td>
	                                <td width="25%">

                                    </td>
	                            </tr>
	                    </tbody>
	                </table>
	            </div>
	        </div>
	    </div>
	    <div class="col-md-12">
	        <div class="panel panel-primary">
	            <div class="panel-heading">
	                <div class="panel-title"><h3>显示字段</h3></div>
	                <div class="panel-options">
		                <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
		            </div>
	            </div>
	            <div class="panel-body with-table">
	                <table class="table table-bordered table-responsive">
	                    <tbody>
	                            <tr>
	                                <td width="20%"><label><input type="checkbox" name="list" value="1"> 组织结构代码</label></td>
	                                <td width="20%"><label><input type="checkbox" name="list" value="2"> 法人</label></td>
	                                <td width="20%"><label><input type="checkbox" name="list" value="3"> 行业类型代码</label></td>
{#	                                <td width="20%"><label><input type="checkbox" name="list" value="4"> 危险化学品生产企业</label></td>#}
{#	                                <td width="20%"><label><input type="checkbox" name="list_5"> 进入工业园区情况</label></td>#}
	                            </tr>
	                            <tr>
	                                <td width="20%"><label><input type="checkbox" name="list" value="5"> 工业园区类型</label></td>
	                                <td width="20%"><label><input type="checkbox" name="list" value="6"> 工业园区代码</label></td>
	                                <td width="20%"><label><input type="checkbox" name="list" value="7"> 近10年发生事故情况</label></td>
{#	                                <td width="20%"><label><input type="checkbox" name="list_9"> 产品产量</label></td>#}
	                                <td width="20%"><label><input type="checkbox" name="list" value="8"> 中间产品产量</label></td>
	                            </tr>
	                            <tr>
{#	                                <td width="20%"><label><input type="checkbox" name="list" value="9"> 原辅料用量</label></td>#}
	                                <td width="20%"><label><input type="checkbox" name="list" value="10"> 危险化学品种类（种）</label></td>
	                                <td width="20%"><label><input type="checkbox" name="list" value="11"> 特征化学污染物种类（种）</label></td>
	                                <td width="20%"><label><input type="checkbox" name="list" value="12"> 联系方式</label></td>
	                            </tr>
	                    </tbody>
	                </table>
	            </div>
	        </div>
	    </div>
	    <div class="col-sm-12">
	        <div class="navbar well clearfix pull-center">
	            <div class="col-sm-4">
	                 <input type="submit" class="btn btn-blue btn-width" value="显示查询结果">
	            </div>
	            <div class="col-sm-4">
	                 <input type="reset" class="btn btn-blue btn-width" value="重置查询条件">
	            </div>
	            <div class="col-sm-4">
	            </div>
	        </div>
	    </div>
    </form>
    <div class="col-md-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <div class="panel-title"><h3>查询结果列表</h3></div>
            </div>
            <div class="panel-body with-table">
                <table class="table table-bordered table-responsive" style="width:{%  widthratio count 1 120 %}px">
                 {% if info %}
                   <label style="color: red;font-size: 16px;">{{ info }} </label>
                {% else %}

                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>单位名称</th>
                        <th>企业地址</th>
                        <th>进入工业园区的情况</th>
                        <th>产品总产量（t/a）</th>
                        <th>产品种类（种）</th>
                        <th>重点环境管理危化品种类（种）</th>
{#                        <th>操作</th>#}
                        <th>填报年</th>
                        {% for l in list %}
                         {% ifequal l '1' %}
                             <th> 组织结构代码</th>
                            {% endifequal %}
                             {% ifequal l '2' %}
                              <th>法人</th>
                            {% endifequal %}
                              {% ifequal l '3' %}
                            <th>行业类型代码</th>
                            {% endifequal %}
{#                              {% ifequal l '4' %}#}
{#                              <th>危险化学品生产企业</th>#}
{#                            {% endifequal %}#}
                              {% ifequal l '5' %}
                             <th>工业园区类型</th>
                            {% endifequal %}
                             {% ifequal l '6' %}
                             <th> 工业园区代码</th>
                            {% endifequal %}
                            {% ifequal l '7' %}
                             <th> 近10年发生事故情况</th>
                            {% endifequal %}
{#                              {% ifequal l '8' %}#}
{#                             <th> 中间产品产量</th>#}
{#                            {% endifequal %}#}
                              {% ifequal l '9' %}
                             <th> 原辅料用量</th>
                            {% endifequal %}
                              {% ifequal l '10' %}
                             <th> 危险化学品种类（种）</th>
                            {% endifequal %}
                              {% ifequal l '11' %}
                             <th> 特征化学污染物种类（种）</th>
                            {% endifequal %}
                              {% ifequal l '12' %}
                             <th> 联系方式</th>
                            {% endifequal %}
                        {% endfor %}
                    </tr>
                    </thead>
                    <tbody>

                    {% for enter in  enterpriseList%}
                            <tr>
                                <td>{{enter.id}}</td>
                                <td>{{enter.getInformation.enterprise_name }}</td>
                                <td>{{ enter.getInformation.register_add2 }}</td>
                                <td>{{ enter.getInformation.industry_park_time }}</td>
                                <td>{{ enter.getProductTotal }}</td>
                                <td>{{ enter.getProductCount }}</td>
                                <td>{{ enter.getProductEmphasis }}</td>
                                <td></td>

                               {% for l in list %}
                         {% ifequal l '1' %}
                             <td> {{ enter.getInformation.organization_code }}</td>
                            {% endifequal %}
                             {% ifequal l '2' %}
                              <td>{{ enter.getInformation.legal_representative }}</td>
                            {% endifequal %}
                              {% ifequal l '3' %}
                            <td>{{ enter.getInformation.industry_code }}</td>
                            {% endifequal %}
{#                              {% ifequal l '4' %}#}
{#                              <td>危险化学品生产企业</td>#}
{#                            {% endifequal %}#}
                              {% ifequal l '5' %}
                             <td>{{ enter.getInformation.industry_park_level }}</td>
                            {% endifequal %}
                             {% ifequal l '6' %}
                             <td> {{ enter.getInformation.industry_park_code }}</td>
                            {% endifequal %}
                            {% ifequal l '7' %}
                             <td> {{ enter.get10year }}</td>
                            {% endifequal %}
{#                              {% ifequal l '8' %}#}
{#                             <td> 中间产品产量</td>#}
{#                            {% endifequal %}#}
                              {% ifequal l '9' %}
                             <td> {{ enter.getMaterialscount }}</td>
                            {% endifequal %}
                              {% ifequal l '10' %}
                             <td> {{ enter.getMaterials }}</td>
                            {% endifequal %}
                              {% ifequal l '11' %}
                             <td> {{ enter.getTz}} </td>
                            {% endifequal %}
                              {% ifequal l '12' %}
                             <td> {{ enter.getInformation.company_contact_information }}</td>
                            {% endifequal %}
                        {% endfor %}
                            </tr>
                    {% endfor %}
                    </tbody>
                 {% endif %}
                </table>
                <div class="row">
                    <div class="col-xs-6 col-left">
                        <div class="dataTables_info" id="table-3_info"></div>
                    </div>
                    <div class="col-xs-6 col-right">
                        <div class="dataTables_paginate paging_bootstrap" style="text-align: right;margin-right: 10px">
                            <ul class="pagination pagination-sm" >
                                {% if ms.has_previous %}
                                    <li><a href="?page={{ ms.previous_page_number }}">上一页</a></li>
                                {% else %}
                                    <li class="disabled"> <span>上一页</span></li>
                                {% endif %}
                                {% for p in paginator.page_range %}
                                    {% ifequal p ms.number %}
                                        <li class="active"> <span class="p">{{p}}</span></li>
                                    {% else%}
                                        <li> <a href="?page={{ p }}">{{p}}</a></li>
                                    {% endifequal %}
                                {% endfor %}
                                {% if ms.has_next %}
                                    <li class="next">  <a href="?page={{ ms.next_page_number }}">下一页</a></li>
                                {% else %}
                                    <li class="disabled"><span>下一页</span></li>
                                {% endif %}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}

{% block js %}
<script src="/static/js/city-choose.js"></script>
<script type="text/javascript">
$(function(){
	$(document).area("se_province","se_city","se_county");//调用插件
    $("#se_province").trigger("change")

})
</script>
{% endblock %}